<?php
function getUniqueCode()
{	
	$code = md5(uniqid(rand(), true));
	return substr($code, 0, 6);
}
echo getUniqueCode();
?>